package com.baizhi.abstractx2;

import java.util.Scanner;

/**
 * 圆形
 */
public class Round extends Shape{
    private double r; //半径



    @Override
    public double area() {
        return 3.14*r*r;
    }

    @Override
    public double perimeter() {
        return 2*3.14*r;
    }

    @Override
    public void inInfo(Scanner scan) {
        System.out.println("请输入圆的半径");
        r = scan.nextDouble();

        //打印图形的面积和周长
        System.out.println("您输入的长方形的面积是：" + area());
        System.out.println("您输入的长方形的周长是：" + perimeter());
    }
}
